from langchain_community.tools import DuckDuckGoSearchRun
from langchain_core.utils.function_calling import convert_to_openai_tool

import json

search = DuckDuckGoSearchRun()

# print(search.invoke('langchain最新版本是哪一个？'))

print("工具名称",search.name)
print("工具描述",search.description)
print("工具参数",search.args)
print("工具工具是否直接返回",search.return_direct)

print(convert_to_openai_tool(search))